package com.freesky.web.portal.reomte;

import com.freesky.common.pojo.Result;
import com.freesky.common.vo.VOCommon;
import com.freesky.common.vo.VOMemberLoginRegist;
import com.freesky.common.vo.portal.VOMember;
import com.freesky.web.portal.reomte.fallback.MemberRemoteFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

@FeignClient(name = "emall-provider-zuul", fallback = MemberRemoteFallback.class)
public interface MemberRemote {
    String ZUUL_URL_PREFIX ="/mysevice/member";
    @GetMapping(value = ZUUL_URL_PREFIX+"/member/geetest-init")
    String geetesrInit();

    @PostMapping(value =ZUUL_URL_PREFIX+ "/member/login")
    Result<VOMember> login(@RequestBody VOMemberLoginRegist memberLoginRegist);

    @GetMapping(value = ZUUL_URL_PREFIX+"/member/login/check")
    Result<VOMember> checkLogin(@RequestParam(value = "token",defaultValue = "") String token);

    @GetMapping( value = ZUUL_URL_PREFIX+"/member/logout")
    Result<Object> logout(@RequestParam(value = "token",defaultValue = "") String token);

    @PostMapping(value =ZUUL_URL_PREFIX+ "/member/register")
    Result<Object> register(@RequestBody VOMemberLoginRegist memberLoginRegist, @RequestParam(value = "request",required = false) HttpServletRequest request);

    @PostMapping(value = ZUUL_URL_PREFIX+"/member/image/upload")
    Result<Object> imgaeUpload(@RequestBody VOCommon common);
}
